package com.xingkeduo.business.user.feign;

import com.xingkeduo.business.user.event.EvenBaseDTO;
import com.xingkeduo.pojo.dto.*;
import com.xingkeduo.pojo.utils.ResponseUtils;
import com.xingkeduo.util.config.FeignConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "business-message", configuration = FeignConfig.class)
public interface SendMsgFeign {

    /**
     * 短信校验
     *
     * @param sendBaseDto:
     * @return : java.lang.String
     * @author : gaozifeng
     * @date : 2019/4/30 15:55
     */
    @PostMapping("/sms/check")
    String checkPhoneAndMsg(@RequestBody SendBaseDto sendBaseDto);


    /**
     * 短信发送
     *
     * @param sendBaseDto:
     * @return : java.lang.String
     * @author : gaozifeng
     * @date : 2019/4/30 15:55
     */
    @PostMapping("/sms/send")
    void send(@RequestBody SendBaseDto sendBaseDto);

    /**
     * 公众号获取用户信息
     *
     * @param mpId:
     * @param accessToken:
     * @param openid:
     * @return : java.lang.String
     * @author : gaozifeng
     * @date : 2019/4/30 15:55
     */
    @GetMapping("/wechat/auth/getuserinfo")
    ResponseUtils<SubscribeDTO> getuserinfo(@RequestParam("mpId") String mpId, @RequestParam("accessToken") String accessToken, @RequestParam("openid") String openid);

    /**
     * 公众号授权获取code
     *
     * @param mpId:
     * @param code:
     * @return : java.lang.String
     * @author : gaozifeng
     * @date : 2019/4/30 15:55
     */
    @GetMapping("/wechat/auth/verify/{mpId}")
    ResponseUtils<WxMpOAuth2AccessToken> verify(@PathVariable("mpId") String mpId, @RequestParam("code") String code);


    /**
     * 小程序获取code
     *
     * @param js_code:
     * @param mobile_type:
     * @return : java.lang.String
     * @author : gaozifeng
     * @date : 2019/5/8 12:49
     */
    @GetMapping("/wechat/xcx/code")
    String code(@RequestParam("js_code") String js_code, @RequestParam("mobile_type") String mobile_type);

    /**
     * 小程序获取用户信息
     *
     * @param :
     * @return : java.lang.String
     * @author : gaozifeng
     * @date : 2019/4/30 15:55
     */
    @RequestMapping("/wechat/xcx/get_user_info")
    String get_user_info(@RequestBody WxEncryDTO wxEncryDTO);

    /**
     * 拿用户code 拉取用户信息
     *
     * @param authCode:
     * @return : java.lang.String
     * @author : gaozifeng
     * @date : 2019/5/10 18:58
     */
    @GetMapping("/message/auth/alipay/verify")
    ResponseUtils<AlipayUserDTO> getAliUserInfo(@RequestParam("code") String authCode);

    /**
     * 用户30天未剪发 提醒
     *
     * @return : com.xingkeduo.pojo.utils.ResponseUtils<java.lang.Boolean>
     * @author : gaozifeng
     * @date : 2019/6/5 15:25
     */
    @RequestMapping("/messagepush/pushHaircutReminderMessage")
    ResponseUtils<Boolean> pushHaircutReminderMessage(@RequestBody List<WxMaUserInfo> wxMaUserInfos);

    @RequestMapping("/callphone/callUserPhone")
    ResponseUtils<String> callUserPhone(@RequestBody PnpLogDTO pnpLogDTO);

    /**
     * 获取二维码
     * @param evenBaseDTO
     * @return   ticket
     */
    @RequestMapping("/wechat/send/{sendingType}")
    ResponseUtils<String> sendWechat(@PathVariable("sendingType") String sendingType,@RequestBody EvenBaseDTO evenBaseDTO);

}
